<template>
	<view class="liItem jc-between">
		<view :style="{backgroundImage: 'url('+dailySong.al.picUrl+')'}" class="musicCover"></view>
		<view class="rightInfo">
			<view class="title ai-center">{{dailySong.name}}<text v-if="!recommendReasons.every(item=>item.songId!=dailySong.id)"
				 class="songTag">{{recommendReasons.find(item=>item.songId==dailySong.id).reason}}</text></view>
			<view class="dsc"><text>{{arName}}</text><text>-{{dailySong.name}}</text></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			dailySong: {
				type: Object,
				default: () => ({
					name: "说散就散",
					al: {
						picUrl: "http://p4.music.126.net/LSBrAS5oxxQHouvqLDR4lA==/19095218439644352.jpg"
					},
					ar: [{
						alias: [],
						id: 12347360,
						name: "JC陈泳彤",
						tns: []
					}],
					id: 468513829
				})
			},
			recommendReasons: {
				type: Array,
				default: () => []
			}
		},
		computed: {
			arName() {
				let nameList = []
				this.dailySong.ar.forEach(item => {
					nameList.push(item.name)
				})
				return nameList.join("、")
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.liItem {
		margin-bottom: 10px;

		>view {
			flex-shrink: 0;
		}

		.musicCover {
			@include bgRepeate('/static/mine/none.png');
			width: 42px;
			height: 42px;
			border-radius: 5px;
		}

		.rightInfo {
			flex: 1;
			display: flex;
			flex-direction: column;
			padding: 4px 10px;
			justify-content: center;
			overflow: hidden;

			>view {
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;

				.songTag {
					font-size: 12px;
					color: $primary;
					background-color: rgba($color: $primary, $alpha: 0.1);
					padding: 2px 4px;
					transform: scale(0.8);
				}
			}

			.title {
				font-size: 16px;
			}

			.dsc {
				font-size: 12px;
				color: #C0C0C0;
			}
		}
	}
</style>
